package com.ijunfu.spring.autowired._02_autowired_setter.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @Title  : 
 * @Author : ijunfu <ijunfu@163.com>
 * @Date   : 2023/11/6 12:40
 * @Version: 1.0
 * @Motto  : 世界很大 世界很小
 *
 */
@Service
public class UserService {

    private RoleService roleService;

    public void printRoleService() {
        System.out.println(roleService);
    }

    public RoleService getRoleService() {
        return roleService;
    }

    // 注入方式二：Setter注入
    @Autowired
    public void setRoleService(RoleService roleService) {
        this.roleService = roleService;
    }
}
